function parseBranch(branchStr) {
  const branchs = branchStr.split('\n').filter(item => item !== '').map(item => item.trim())
  const currentBranchIndex = branchs.findIndex(branch => branch.includes('*'))
  const currentBranch = branchs[currentBranchIndex].replace('* ', '')
  branchs.splice(currentBranchIndex , 1)
  branchs.unshift(currentBranch)
  return branchs
}

module.exports = parseBranch